import React, { Component } from 'react';
import './index.css'
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as getRecommend from "../../store/actionCreators";
import Footer from '../../components/Footer';
import Nav from '../../components/Nav';
import Public from '../../components/Public'
import Banner from '../../components/Banner'
import Tuijian from '../../components/Tuijian'
class Selected extends Component {
  state = {
    list: []
  }
  componentDidMount() {
    const a = 'index_recommend_v0722'
    this.props.getRecommend(a)
    
  }
  render() {
    const { baijin, banner,dujia} = this.props.list
    return (
      <div className='selected-box'>
        <Banner data={banner} />
        <Nav />
        <Tuijian data={dujia} />
        <div className='app_banner'>
          <img src="https://m.chuangbie.com/static/img/1_banner.287ec1f3.png" alt="" />
        </div>
        <Public data={baijin} title={'白金作品'} />
        <Footer />
        <div style={{ height: '.6rem' }}></div>
      </div>
    );
  }
}
function mapStateToProps(state) {
  // console.log(state);
  return {
    list: state.recommend,
  }
}
function mapDispatchToProps(dispatch) {
  return {
    ...bindActionCreators(getRecommend, dispatch)
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(Selected);